from django.db import models
from django.contrib.auth.models import AbstractUser


class User(AbstractUser):
    # 默认提供了属性，用户名/密码/邮箱...
    # 定义新的属性，向表中添加
    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号')
    # 新增属性：邮箱是否激活
    email_active = models.BooleanField(default=False)

    class Meta:
        db_table = 'tb_users'
        verbose_name = '用户'
        verbose_name_plural = verbose_name
